<!DOCTYPE html>
<html>
<head>

<style>
.option2 {
	background-color: #00FF99;
	cursor:pointer;
}

.option1{
	cursor:pointer;
}
</style>
<title>Tabbed Content</title>
<script src="../js/tabcontent.js" type="text/javascript"></script>
<link href="../css/tabcontent.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<input type="button" value="View Project Status" style="float: right;"
		onclick="location.href='Restrictions.html'">
	<br>
	<br>
	<div
		style="width: 100%; padding: 0px 0 0px; font: 0.85em arial; height: 430px; margin-right: auto; margin-top: 0; margin-bottom: 0; text-align: center">
		<ul class="tabs">
			<li><a href="#" rel="view1">PHD</a></li>
			<li><a href="#" rel="view2">MTECH</a></li>
			<li><a href="#" rel="view3">BTECH</a></li>

		</ul>
		<div class="tabcontents">
			<div id="view1" class="tabcontent">
				<?php
				$con=mysql_connect("localhost","root","");
				if(!$con)
				{
					die("Unable to connect to database");
				}
				mysql_select_db("se_group2",$con);
				$result=mysql_query("SELECT name,GID FROM student LEFT JOIN group_student ON student.UID=group_student.UID WHERE estatus=2;");
				while($row=mysql_fetch_array($result))
				{
					$name=$row['name'];
					$GID=$row['GID'];
					if($GID==NULL)
					{
						echo '<p class="option2">'.$name.'</p>';
					}
					else
						echo '<p class="option1">'.$name.'</p>';
				}
				?>
			</div>
			<div id="view2" class="tabcontent">
			 	<?php
				$result=mysql_query("SELECT name,GID FROM student LEFT JOIN group_student ON student.UID=group_student.UID WHERE estatus=1 ORDER BY roll_no;");
				while($row=mysql_fetch_array($result))
				{
					$name=$row['name'];
					$GID=$row['GID'];
					if($GID==NULL)
					{
						echo '<p class="option2">'.$name.'</p>';
					}
					else
						echo '<p class="option1">'.$name.'</p>';
				}
				?>
			</div>
			<div id="view3" class="tabcontent">
				<?php
				$result=mysql_query("SELECT student.UID,name,GID FROM student LEFT JOIN group_student ON student.UID=group_student.UID WHERE estatus=0 ORDER BY roll_no;");
				while($row=mysql_fetch_array($result))
				{
					$name=$row['name'];
					$GID=$row['GID'];
					if($GID==NULL)
					{
						echo '<p class="option2">'.$name.'</p>';
					}
					else
						echo '<p class="option1">'.$name.'</p>';
				}
				?>
			</div>

		</div>
	</div>
</body>
</html>
